package com.wswy.wzcx.module;

import android.content.Context;
import com.wswy.wzcx.BuildConfig;
import com.meituan.android.walle.WalleChannelReader;
import com.wswy.wzcx.AppContext;

public class ChannelManager {

  private static final String DEFAULT_CHANNEL = BuildConfig.CHANNEL;

  private static String sChannel;

  public static String getChannel(Context context){
    if(sChannel == null){
      sChannel = WalleChannelReader.getChannel(context);
    }
    if(sChannel == null){
      sChannel = DEFAULT_CHANNEL;
    }
    return sChannel;
  }

  public static String getChannel(){
    if(sChannel == null){
      return getChannel(AppContext.getContext());
    }
    return sChannel;
  }

}
